﻿using 特性.Attr;
using 特性.Extend;

namespace 特性.Model
{
    public class UserInfo
    {
        public string Name { get; set; }
        public int Id { get; set; }
        public int Age { get; set; }

        [CustomerValidate(2, 11, msg = "手机号必须是2至11位")]
        public string Phone { get; set; }

        public UserStateEnum UserStateEnum { get; set; }

        public string StrDescription
        {
            get
            {
                return this.UserStateEnum.GetDescription();
            }
        }
    }

    public enum UserStateEnum
    {
        /// <summary>
        /// 正常
        /// </summary>
        [Remark("正常")]
        Normal = 1,

        /// <summary>
        /// 冻结
        /// </summary>
        [Remark("冻结")]
        Frozen = 2,

        /// <summary>
        /// 已删除
        /// </summary>
        [Remark("删除")]
        Deleted = 3,
    }
}